﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using blackhouse.BlackApart.Actions.Log;
using System.ComponentModel;

namespace blackhouse.BlackApart.Web {

    [System.ComponentModel.DataObject]
    public class DalActionLog : IActionLog {

        #region Fields

        private IActionLog dec = new ImpActionLog();
        private IActionLog[] logs = new IActionLog[0];

        #endregion

        public int LogId {
            get { return this.dec.LogId; }
        }

        public DateTime StartDate {
            get { return this.dec.StartDate; }
            set { this.dec.StartDate = value; }
        }

        public DateTime EndDate {
            get { return this.dec.EndDate; }
            set { this.dec.EndDate = value; }
        }

        public ActionStatus Status {
            get { return this.dec.Status; }
            set { this.dec.Status = value; }
        }

        public string Message {
            get { return this.dec.Message; }
            set { this.dec.Message = value; }
        }

        public string Title {
            get { return this.dec.Title; }
            set { this.dec.Title = value; }
        }

        public void Save() {
            this.dec.Save();
        }

        public IActionLog AssignNewLogToAction(BlackApart.Actions.Action action) {
            return this.dec.AssignNewLogToAction(action);
        }

        public void AppendToMessage(string message) {
            this.dec.AppendToMessage(message);
        }

        public void AssignSelect(IActionLog[] logs) {
            this.logs = logs;
        }

        [DataObjectMethod(DataObjectMethodType.Select)]
        public IActionLog[] Select() {
            return this.logs;
        }

    }
}